//
//  BaseAlertTableView.m
//  MurderMystery
//
//  Created by administrator on 2018/8/1.
//  Copyright © 2018年 luomz. All rights reserved.
//

#import "BaseAlertTableView.h"
#import "WSButton.h"
#import "WSConst.h"

@implementation BaseAlertTableView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.layer.masksToBounds = YES;
        self.layer.cornerRadius = 5;
        
        self.closeBtn.frame = CGRectMake(frame.size.width - 40, 10, 30, 30);
    }
    return self;
}
- (UIButton *)closeBtn {
    if (!_closeBtn) {
        _closeBtn = [ExtendTouchAreaButton buttonWithType:UIButtonTypeCustom];
        [_closeBtn setImage:WSImage(@"alert_close")forState:UIControlStateNormal];
        [_closeBtn addTarget:self action:@selector(closeAction ) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:_closeBtn];
        [self bringSubviewToFront:_closeBtn];
        
        _closeBtn.extendedWidth = 40;
        _closeBtn.extendedHeight = 40;
    }
    return _closeBtn;
}

- (void)closeAction {
    
    [self didAction:kAction(1)];
}

@end
